package c.e.a.b.b.j;

import android.os.StrictMode;
import android.os.StrictMode.ThreadPolicy;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class f {
    public static String a;
    public static int b;

    /* JADX WARNING: Removed duplicated region for block: B:26:0x004d A:{SYNTHETIC, Splitter:B:26:0x004d} */
    /* JADX WARNING: Removed duplicated region for block: B:19:0x0046 A:{SYNTHETIC, Splitter:B:19:0x0046} */
    @javax.annotation.Nullable
    public static java.lang.String a() {
        /*
        r0 = a;
        if (r0 != 0) goto L_0x0052;
    L_0x0004:
        r0 = b;
        if (r0 != 0) goto L_0x000e;
    L_0x0008:
        r0 = android.os.Process.myPid();
        b = r0;
    L_0x000e:
        r0 = b;
        r1 = 0;
        if (r0 > 0) goto L_0x0014;
    L_0x0013:
        goto L_0x0050;
    L_0x0014:
        r2 = 25;
        r3 = new java.lang.StringBuilder;	 Catch:{ IOException -> 0x004a, all -> 0x0043 }
        r3.<init>(r2);	 Catch:{ IOException -> 0x004a, all -> 0x0043 }
        r2 = "/proc/";
        r3.append(r2);	 Catch:{ IOException -> 0x004a, all -> 0x0043 }
        r3.append(r0);	 Catch:{ IOException -> 0x004a, all -> 0x0043 }
        r0 = "/cmdline";
        r3.append(r0);	 Catch:{ IOException -> 0x004a, all -> 0x0043 }
        r0 = r3.toString();	 Catch:{ IOException -> 0x004a, all -> 0x0043 }
        r0 = b(r0);	 Catch:{ IOException -> 0x004a, all -> 0x0043 }
        r2 = r0.readLine();	 Catch:{ IOException -> 0x0041, all -> 0x003c }
        r1 = r2.trim();	 Catch:{ IOException -> 0x0041, all -> 0x003c }
        r0.close();	 Catch:{ IOException -> 0x0050 }
        goto L_0x0050;
    L_0x003c:
        r1 = move-exception;
        r4 = r1;
        r1 = r0;
        r0 = r4;
        goto L_0x0044;
        goto L_0x004b;
    L_0x0043:
        r0 = move-exception;
    L_0x0044:
        if (r1 == 0) goto L_0x0049;
    L_0x0046:
        r1.close();	 Catch:{ IOException -> 0x0049 }
    L_0x0049:
        throw r0;
    L_0x004a:
        r0 = r1;
    L_0x004b:
        if (r0 == 0) goto L_0x0050;
    L_0x004d:
        r0.close();	 Catch:{ IOException -> 0x0050 }
    L_0x0050:
        a = r1;
    L_0x0052:
        r0 = a;
        return r0;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.e.a.b.b.j.f.a():java.lang.String");
    }

    public static BufferedReader b(String str) throws IOException {
        ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
        try {
            BufferedReader bufferedReader = new BufferedReader(new FileReader(str));
            return bufferedReader;
        } finally {
            StrictMode.setThreadPolicy(allowThreadDiskReads);
        }
    }
}
